#ifndef __MACRO_H__
#define __MACRO_H__

//各种宏定义

#define MAX_ERROR_STR 2048 //显示错误信息最大数组长度
#define Cpymem(dst, src, n) (((u_char *)memcpy(dst, src, n)) + (n))
#define MyMin(val1, val2) ((val1>val2)?(val2):(val1))

//数字相关
#define MAX_UINT32_VALUE (uint32_t) 0xffffffff
#define INT64_LEN        (sizeof("-12345678912345678912") - 1)

//日志相关
#define LOG_STDERR           0
#define LOG_EMERG            1
#define LOG_ALERT            2
#define LOG_CRIT             3
#define LOG_ERR              4
#define LOG_WARN             5
#define LOG_NOTICE           6
#define LOG_INFO             7
#define LOG_DEBUG            8

#define ERROR_LOG_PATH  "error.log"

#define PROCESS_MASTER      0
#define PROCESS_WORKER      1

#endif
